package com.ebank.view;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class Main extends HttpServlet {

	protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		HttpSession session=req.getSession();
		PrintWriter out = res.getWriter();
		if(session.getAttribute("username")!=null){
		res.setContentType("text/html;charset=utf-8");
		req.getRequestDispatcher("/View/Main.jsp").forward(req, res);
		}else{ req.getRequestDispatcher("/View/Wong.jsp").forward(req, res);
		} 
	}
	protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		this.doGet(req, res);
	}
}
